﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MoeRabbit
{
    class ListSplit
    {public void List_Split(string dataFile)
        {
            List<String> All_Line = File.ReadAllLines(StaticValue.Oldurl1).ToList<string>();
            List<String> Temp = new List<string>();
            Console.WriteLine(All_Line.Count);
            int i = 1;
            foreach (String LINE in All_Line)
            {
                Temp.Add(LINE);
                Console.WriteLine(Temp.Count);
                if (Temp.Count % 980 == 0)
                {
                    new FileExistence().DicExt(StaticValue.Listtemp1);
                    String filepath = StaticValue.Listtemp1 + string.Format("new_{0}_{1}.lst", i++, Path.GetFileNameWithoutExtension(dataFile));
                    Console.WriteLine(filepath);
                    File.AppendAllLines(filepath, Temp);
                    Temp = new List<string>();
                }
            }

        }

    }
}
